package com.itlong.cloud.operate.resource;

import com.itlong.cloud.POJO.DTO.operate.OperateBankCardGetPageDTO;
import com.itlong.cloud.POJO.VO.operate.OperateBankCardVO;
import com.itlong.cloud.operate.service.IOperateBankCardManageService;
import com.itlong.cloud.paymenthub.IOperateBankCardManageServiceClient;
import com.itlong.cloud.utils.page.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <desc>
 *      运营银行卡管理暴露接口实现类
 * </desc>
 *
 * @createDate 2018/09/25
 */
@RestController
public class OperateBankCardManageServiceResource implements IOperateBankCardManageServiceClient{

    @Autowired
    IOperateBankCardManageService iOperateBankCardManageService;

    /**
     * <desc>
     *      获取银行卡账号详情
     * <desc/>
     *
     * @param bankCardId
     * @param projectId
     * @return
     * @author Jiaqi.X
     * @createDate 2018/09/20
     */
    @Override
    @PostMapping(path = "/operate/finance/bankCardManage/getCardInfo")
    public OperateBankCardVO getCardInfo(@RequestParam("bankCardId") String bankCardId) {
        return iOperateBankCardManageService.getCardInfo(bankCardId);
    }

    /**
     * <desc>
     *      提交审核
     * </desc>
     *
     * @param bankCardId
     * @param checkStatus
     * @param remark
     * @return
     * @author Jiaqi.X
     * @createDate 2018/09/25
     */
    @PostMapping(path = "/operate/finance/bankCardManage/checkSubmit")
    @Override
    public Integer checkSubmit(@RequestParam("bankCardId") String bankCardId,
                               @RequestParam("checkStatus") Integer checkStatus,
                               @RequestParam("remark") String remark,
                               @RequestParam("approver") String approver) {
        return iOperateBankCardManageService.checkSubmit(bankCardId,checkStatus,remark,approver);
    }

    /**
     * <desc>
     *     获取抄银行卡账户列表
     * </desc>
     *
     * @param pageDTO   参数DTO
     * @return
     * @author Jiaqi.X
     * @createDate 2018/08/15
     */
    @PostMapping(path = "/operate/finance/bankCardManage/getPage")
    @Override
    public Page<OperateBankCardVO> getPage(@RequestBody OperateBankCardGetPageDTO pageDTO) throws Exception{
        return iOperateBankCardManageService.getPage(pageDTO);
    }
}
